package com.deke.course.controller;

import com.aaa.common.entity.EduSubject;
import com.aaa.common.vo.Result;
import com.deke.course.service.EduSubjectService;
import com.deke.course.vo.SubjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/core/subject")
@Api(tags = "课程分类接口类")
public class CourseSortController {

    @Autowired
    private EduSubjectService subjectService;

    @ApiOperation(value = "根据条件分页查询课程分类信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageCurrent",value = "当前页码"),
            @ApiImplicitParam(name = "pageSize",value = "每页显示的条数"),
    })
    @PostMapping ("/findsubject/{pageCurrent}/{pageSize}")
    public Result findsubject(@RequestBody SubjectVo subjectVo,
                              @PathVariable Integer pageCurrent,
                              @PathVariable Integer pageSize
                              ){
        return subjectService.findByConditionPage(subjectVo,pageCurrent,pageSize);
    }

}
